export default class Util{
    static getRandom(m, n) {
        var x = Math.max(m, n)
        var y = Math.min(m, n)
        return Math.floor(Math.random() * (x - y) + y)
    }
    /**
     * 计算总价
     * @param {*} cartList 
     * @returns 
     */
    static totalPrice(cartList){
       return cartList.reduce((s,item)=>s+= item.state?Number(item.singlePrice):0,0).toFixed(2)
    }
}